package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageBean;
import com.zzyl.mapper.CustomerOrderMapper;
import com.zzyl.service.CustomeOrderService;
import com.zzyl.vo.NursingProjectVo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class CustomerMemberServiceImpl implements CustomeOrderService {
    private final CustomerOrderMapper customerOrderMapper;
    @Override
    public PageBean<NursingProjectVo> page(String name, Integer pageNum, Integer pageSize, Integer status) {
        pageNum = Math.max(pageNum, 1);
        pageSize = Math.max(pageSize, 1);
        PageHelper.startPage(pageNum, pageSize);
        System.out.println(pageNum);
        System.out.println(pageSize);
        System.out.println(name);
        System.out.println(status);
        Page<NursingProjectVo> result = (Page<NursingProjectVo>) customerOrderMapper.page(name, pageNum, pageSize, status);
        System.out.println(result);
        return PageBean.of(result);
    }

    @Override
    public NursingProjectVo getIdList(Integer id) {
        NursingProjectVo nv = customerOrderMapper.getIdList(id);
        return nv;
    }
}
